Improve i18n_tool.py list-translators, update-from-weblate#5571
Improve i18n_tool.py list-translators, update-from-weblate#5571
Conversation
dd48337 to
cc06bf7
Compare
cc06bf7 to
5fd0c69
Compare
8548a74 to
eda32da
Compare
|
This pull request introduces 1 alert when merging eda32da into ce22827 - view on LGTM.com new alerts:
|
73a5a22 to
3c85c6f
Compare
Allow the specification of a commit whose timestamp will be used as the starting point for gathering translator credits, instead of starting from the last commit that says "l10n: sync". That breaks badly if there are any source string changes during the release cycle that require another sync, so instead, just examine all the commits since the time of the specified revision, defaulting to the last release tag. Also, instead of always gathering translator contributions up to the tip of i18n/i18n for list-translators and update-from-weblate, allow the specification of a commit. This is intended to allow verification of these functions' results; release management tasks should use the default target of the i18n/i18n branch tip.
3c85c6f to
79640ee
Compare
There was a problem hiding this comment.
The code change looks good. but, I had some trouble in following the test steps:
❯ git checkout -b test-i18n-merge 8b50a9e3c
Switched to a new branch 'test-i18n-merge'
❯ git checkout improve-list-translators -- securedrop/i18n_tool.py && git commit -m 'get new i18n_tool.py'
fatal: invalid reference: improve-list-translators
@rmol Should I manually copy paste and test? (I guess yes)
|
@kushaldas Thanks for looking, and sorry about that command -- if you don't already have the branch checked out locally, the command should be: |
kushaldas
left a comment
There was a problem hiding this comment.
The code change looks good. Tested with the following instructions:
Testing
Verify that i18n_tool.py update-from-weblate produces the same translations it did for 1.6.0
-
Create a
test-i18n-mergebranch starting atdevelopas of the creation of thei18n-mergebranch for 1.6.0:git checkout -b test-i18n-merge 8b50a9e3c -
Check out
i18n_tool.pyfrom theimprove-list-translatorsbranch:git checkout improve-list-translators -- securedrop/i18n_tool.py && git commit -m 'get new i18n_tool.py' -
Activate your virtualenv and update the translations from the
i18n/i18nbranch at the same commit used for 1.6.0:python3 securedrop/i18n_tool.py update-from-weblate --target d34ba2a576bf7ef3faf25fb3e903a492ddff0bac -
Verify that the translations match 1.6.0:
git diff --stat origin/release/1.6.0 -- securedrop/translationsNo differences should be reported.
Verify the output of i18n_tool.py list-translators
-
Run
python3 securedrop/i18n_tool.py list-translators --target d34ba2a576bf7ef3faf25fb3e903a492ddff0bac --since 1.5.0and compare the output to the contributors listed in the commit messages from runninggit logon thetest-i18n-mergebranch back to the commit cherry-pickingi18n_tool.py. -
Run
python3 securedrop/i18n_tool.py list-translators. The translators credited should match the authors of commits since thei18ncommit that went into 1.6.0, which you can obtain withgit log d34ba2a576bf7ef3faf25fb3e903a492ddff0bac..i18n/i18n.
Status
Ready for review
Description of Changes
Fixes #5570.
Allow the specification of a commit whose timestamp will be used as the starting point for gathering translator credits, instead of
starting from the last commit that says "l10n: sync". That breaks badly if there are any source string changes during the release cycle that require another sync, so instead, just examine all the commits since the time of the specified revision, defaulting to the last release tag.
Also, instead of always gathering translator contributions up to the tip of
i18n/i18nforlist-translatorsandupdate-from-weblate, allow the specification of a commit. This is intended to allow verification of these functions' results; release management tasks should use the default target of thei18n/i18nbranch tip.Testing
Verify that
i18n_tool.py update-from-weblateproduces the same translations it did for 1.6.0Create a
test-i18n-mergebranch starting atdevelopas of the creation of thei18n-mergebranch for 1.6.0:git checkout -b test-i18n-merge 8b50a9e3cCheck out
i18n_tool.pyfrom theimprove-list-translatorsbranch:git checkout improve-list-translators -- securedrop/i18n_tool.py && git commit -m 'get new i18n_tool.py'Activate your virtualenv and update the translations from the
i18n/i18nbranch at the same commit used for 1.6.0:python3 securedrop/i18n_tool.py update-from-weblate --target d34ba2a576bf7ef3faf25fb3e903a492ddff0bacVerify that the translations match 1.6.0:
git diff --stat origin/release/1.6.0 -- securedrop/translationsNo differences should be reported.
Verify the output of
i18n_tool.py list-translatorsRun
python3 securedrop/i18n_tool.py list-translators --target d34ba2a576bf7ef3faf25fb3e903a492ddff0bac --since 1.5.0and compare the output to the contributors listed in the commit messages from runninggit logon thetest-i18n-mergebranch back to the commit cherry-pickingi18n_tool.py.Run
python3 securedrop/i18n_tool.py list-translators. The translators credited should match the authors of commits since thei18ncommit that went into 1.6.0, which you can obtain withgit log d34ba2a576bf7ef3faf25fb3e903a492ddff0bac..i18n/i18n.Deployment
A bug here could result in translations not making it to production, so the localization managers for 1.7.0 should give the results of
update-from-weblateandlist-translatorsextra scrutiny.Checklist
If you made changes to the server application code:
make lint) and tests (make test) pass in the development containerIf you made non-trivial code changes: